<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch benben-position-layout flex chooseLogisticsCompany_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-between chooseLogisticsCompany_fd0_0'>
					<view
						class='flex flex-wrap align-center chooseLogisticsCompany_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  chooseLogisticsCompany_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text
							class='chooseLogisticsCompany_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>选择物流公司</text>
					</view>
					<view class='flex align-center justify-end chooseLogisticsCompany_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view
				class="flex flex-direction flex-wrap align-stretch benben-position-layout flex chooseLogisticsCompany_flex_1"
				:style="{top:(88+StatusBarRpx)+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-center chooseLogisticsCompany_fd1_0'>
					<view class='flex flex-wrap align-center chooseLogisticsCompany_fd1_0_c0'>
						<image
							class='chooseLogisticsCompany_fd1_0_c0_c0'
							mode="aspectFit"
							:src='STATIC_URL+"482.png"'
						></image>
						<input
							type="text"
							v-model="keywords"
							placeholder="搜索物流公司"
							class='chooseLogisticsCompany_fd1_0_c0_c1'
							placeholder-style="color: #999999;"
						>
					</view>
				</view>

			</view>
			<view :style="{height: '110rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout chooseLogisticsCompany_flex_2">

				<!-- 详情状态 -->
				<fu-empty v-if="pageLoading"></fu-empty>

				<benben-select-diy
					ref="showSelectPopup1657262172219"
					class-name='flex flex-direction align-stretch flex chooseLogisticsCompany_fd2_0'
					:items.sync="dataList"
					v-model="logistics.logistics_id"
					:label.sync="logistics.logistics_name"
					@change="throwLogisticsFunc()"
					default-type="id"
					default-label="name"
					:allow-cancel='true'
					type="radio"
					:disabled='false'
				>
					<template v-for='(item,key0) in dataList'>
						<view
							v-if="item.isSelected"
							class='flex align-center justify-between flex chooseLogisticsCompany_fd2_0_c0'
							:key="key0"
							@tap="$refs.showSelectPopup1657262172219.tapHandle(key0)"
						>
							<text class='chooseLogisticsCompany_fd2_0_c0_c0'>{{item.name}}</text>
							<image
								class='chooseLogisticsCompany_fd2_0_c0_c1'
								mode="aspectFit"
								:src='STATIC_URL+"682.png"'
							></image>
						</view>
						<view
							v-else
							class='flex align-center justify-between flex chooseLogisticsCompany_fd2_0_c0'
							:key="key0"
							@tap="$refs.showSelectPopup1657262172219.tapHandle(key0)"
						>
							<text class='chooseLogisticsCompany_fd2_0_c1_c0'>{{item.name}}</text>
							<image
								class='chooseLogisticsCompany_fd2_0_c0_c1'
								mode="aspectFit"
								:src='STATIC_URL+"135.png"'
							></image>
						</view>
					</template></benben-select-diy>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import { validate } from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				keywords: "",
				"logistics": {
					"logistics_id": "",
					"logistics_name": ""
				},
				"logistics_type": [],
				"logistics_id": "",
				"dataList": [],
				timer: null,
				pageLoading: true,
			};
		},
		computed: {
			themeColor() { return this.$store.getters.themeColor },
		},
		watch: {
			keywords() {
				clearTimeout(this.timer);
				this.timer = setTimeout(() => {
					console.debug(this.logistics_type);
					this.dataList = this.logistics_type.filter(item => ~item.name.indexOf(this.keywords));
				}, 100)
			}
		},
		onLoad(options) {
			this.getLogisticsFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getLogisticsFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取物流公司
			async getLogisticsFunc() {
				//请求方法
				//数据验证
				try {

					let datadataList = await this.$api.post(`/${this.apiFix}/6555d11744505`, {

					});

					if (datadataList.data.code != 1) {
						this.$message.info(datadataList.data.msg);
						return
					}
					let infodataList = datadataList.data;
					this.dataList = this.logistics_type = infodataList.data;
				} catch (e) {}
				this.pageLoading = false;
			},
			//抛出
			throwLogisticsFunc() {
				uni.$emit('logistics', this.logistics)
				this.$urouter.navigateBack(1);
			}
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.chooseLogisticsCompany_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/480.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.chooseLogisticsCompany_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 200rpx;
	}

	.chooseLogisticsCompany_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
	}

	.chooseLogisticsCompany_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
		font-weight: 500;
	}

	.chooseLogisticsCompany_fd0_0_c0 {
		width: 200rpx;
	}

	.chooseLogisticsCompany_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.chooseLogisticsCompany_flex_1 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/480.png) no-repeat;
		width: 750rpx;
		height: 110rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background-size: 100% auto;
	}

	.chooseLogisticsCompany_fd1_0_c0_c1 {
		font-size: 28rpx;
		font-weight: 500;
		margin: 0rpx 0rpx 0rpx 16rpx;
		flex: 1;
	}

	.chooseLogisticsCompany_fd1_0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.chooseLogisticsCompany_fd1_0_c0 {
		background: #F7F6F4;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		width: 690rpx;
		height: 72rpx;
		padding: 0 32rpx;
		box-sizing: border-box;
	}

	.chooseLogisticsCompany_fd1_0 {
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		padding: 40rpx 0rpx 0rpx 0rpx;
	}

	.chooseLogisticsCompany_flex_2 {
		background: var(--benbenbgColor1);
		padding: 0rpx 24rpx 0rpx 24rpx;
		background-size: 100% auto;
	}

	.chooseLogisticsCompany_fd2_0_c1_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #111111;
	}

	.chooseLogisticsCompany_fd2_0_c0_c1 {
		width: 36rpx;
		height: 36rpx;
	}

	.chooseLogisticsCompany_fd2_0_c0_c0 {
		background: #FFFFFF;
		font-size: 32rpx;
		font-weight: 400;
		color: #111111;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
	}

	.chooseLogisticsCompany_fd2_0_c0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	::v-deep .chooseLogisticsCompany_fd2_0 {
		margin: 8rpx 0rpx 0rpx 0rpx;
	}
</style>